﻿using System;
using System.Linq.Expressions;
using Lucene.Net.Analysis;

namespace Lucene.Linq.Expressions
{
    internal class FieldExpression : Expression
    {
        private readonly string _alias;
        private readonly Analyzer _analyzer;
        private readonly string _name;
        private readonly int _ordinal;

        internal FieldExpression(Type type, string alias, string name, int ordinal, Analyzer analyzer)
            : base((ExpressionType) LuceneExpressionType.Field, type)
        {
            _alias = alias;
            _name = name;
            _ordinal = ordinal;
            _analyzer = analyzer;
        }

        internal Analyzer Analyzer
        {
            get { return _analyzer; }
        }

        internal string Alias
        {
            get { return _alias; }
        }

        internal string Name
        {
            get { return _name; }
        }

        internal int Ordinal
        {
            get { return _ordinal; }
        }
    }
}